import 'package:flutter/material.dart';
import 'package:flutter_scaffold/flutter_scaffold.dart';

class LayoutBuildDemoPage extends StatefulWidget {
  const LayoutBuildDemoPage({super.key});

  @override
  State createState() {
    return _LayoutBuildDemoPageState();
  }
}

class _LayoutBuildDemoPageState extends State<LayoutBuildDemoPage> {
  @override
  void initState() {
    super.initState();
  }

  @override
  void dispose() {
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Container(
          height: double.infinity,
          width: double.infinity,
          color: Colors.red,
          child: LayoutBuilder(builder: (context,cons){
            /// 屏幕像素宽高
            var screenSize = MediaQuery.of(context).size * MediaQuery.of(context).devicePixelRatio;
            Log.i(screenSize);
            return Center(child: Text("父布局约束:$cons \n 屏幕像素宽高:${screenSize}"));
          }),
      ),
    );
  }
}
